$(function(){
//	
	$(".button").click(function(){

		var user = $("input[name=admin]").val();
		var pwd = $("input[name=password]").val();
		var code = $("input[name=passcode]").val();
		$.ajax({
			type:"post",
			url:APP+"/Lmkj/Login/ajaxUser",
			data : {
				'user' : user,
				'pwd'  : pwd ,
				'code' : code
			},
			dataType : 'json',
			beforeSend : function(){
				$("<div/>").html('等待中...');
			},
			success : function(data){
				if(data == 1){
					Showbo.Msg.alert('登录成功!');
					window.location.href = APP+"/Lmkj/Index/index";
				}else if(data == 2){
					Showbo.Msg.alert('验证码错误!');
				}else{
					Showbo.Msg.alert('用户名或密码错误!');
				}
			}
		});
	})
	
	//验证码点击更换
	$(".passcode").click(function(){
		var src = $(this).attr('src');
		var url = APP+"/Lmkj/Login/verify";
		$(this).attr('src',url);
	})

})



